<%@ page language="java" import="java.util.*" import="java.text.SimpleDateFormat" pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>在线点餐系统管理平台</title>
<link rel="stylesheet" href="${pageContext.request.contextPath }/admin/css/reset.css" type="text/css" media="screen" />
<link rel="stylesheet" href="${pageContext.request.contextPath }/admin/css/style.css" type="text/css" media="screen" />
<link rel="stylesheet" href="${pageContext.request.contextPath }/admin/css/invalid.css" type="text/css" media="screen" />
<script type="text/javascript" src="${pageContext.request.contextPath }/admin/scripts/jquery-1.7.1.min.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath }/admin/scripts/simpla.jquery.configuration.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath }/admin/scripts/facebox.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath }/admin/scripts/jquery.wysiwyg.js"></script>

<script type="text/javascript">

 $(document).ready(function(){

           $('#newpwd').focus(function(){
              var _newpwd=$('#newpwd').val(); 
              if(_newpwd==""){
              	$("#newPwdSpan").html(" 请填写新密码！");return;
              }
            });
            $('#newpwd').blur(function(){
              var _newpwd=$('#newpwd').val();
             if(_newpwd==""){
              	$("#newPwdSpan").html(" 请填写新密码！");
              	$("#tijiao").attr("disabled",'true');
              	return;
              }else{
                      	$("#newPwdSpan").html("<font color='green'>ok</font>");
		              $('#renewpwd').focus(function(){
		              var _renewpwd=$('#rernewpwd').val(); 
		              if(_renewpwd==""){
		              	$("#renewPwdSpan").html(" 请填写确认新密码！");
		              };
		            }); $('#renewpwd').keyup(function(){
			                var _renewpwd=$('#renewpwd').val();
			                if(_renewpwd==""){
			              	$("#renewPwdSpan").html("请填写确认新密码！");
		              	 }else{
		              	    if($('#newpwd').val()!=$('#renewpwd').val()){
		              	    		$("#renewPwdSpan").html("<font color='red'>两次密码输入不一致！</font>");
		              	    }else{
		              	    	$("#renewPwdSpan").html("<font color='green'>ok</font>");
		              	    }
		              	 }
		              });
                 }
            });
            $("#tijiao").click(function (){
             var _newpwd=$('#newpwd').val(); 
              var _renewpwd=$('#renewpwd').val();
              if(_newpwd!= _renewpwd){
              	$("#renewPwdSpan").html("<font color='red'>两次密码输入不一致！</font>");
              	return;
              }
            
            var url="userManager!upSysUserinfoPwd";
            $.post(url,{"repwd":_renewpwd,"username":'${adminUser.username}'},function(data){
            	if(data>0){
            		alert("修改成功！");
            	}
            	else{
            	    alert("修改失败！");
            	}
            });
            });
       }); 
     
</script>
</head>
<body>
  <%-- 加载左边菜单 --%>
  <s:include value="../main/left.jsp?mid=m65"></s:include>
	<div class="clear"></div>
  <div id="main-content">
    <!-- Box Content -->
    <div class="content-box">
    	<!-- Box Header -->
      <div class="content-box-header">
        <h3>修改用户密码</h3>
        <div class="clear"></div>
      </div>
      <!-- End Box Header -->     
  
      <div class="tab-content">
        
        	 <p/>
          <p/>
          	<label>用户名：${adminUser.username } </label>
            <br />
          <p/>
            <p/>
	          	<label>新 &nbsp;密 &nbsp;码：</label>
	          
	            <s:password cssClass="text-input small-input" id="newpwd"/>
	            <span id="newPwdSpan"></span>
	            <br />
	      
          <p/>
             	<label>确认密码：</label>
	           <s:password cssClass="text-input small-input" id="renewpwd"/>
	           <span id="renewPwdSpan"></span>
	            <br />
          <p/><input class="button" type="button"   id="tijiao" value="提  交" onclick="submitFood($('#foodType').val())"/></p>
          
      
      </div>
      <!-- End Table Content -->
     </div>
     
     <!-- End Box Content -->
  
	<div class="clear"></div>
	<%-- 加载底部 --%>
	<s:include value="../main/footer.jsp"></s:include>
	</div>
</body>
</html>

